#!/usr/bin/env python
import os,sys



def domain_input(domain=""):
    if domain =="":
        domain = raw_input("Please input domain :")
        domain_input(domain)
        return domain



def write_nginx_config(domain,working_directory,addtionalDomain = ""):
    defaultConfig = """
upstream %s {
    ip_hash;
    server unix:%s;
}
server {

    listen 80;
    server_name %s %s ;
    index index.html index.htm ;
    
    location / {
        include uwsgi_params;
        uwsgi_pass %s;
    }
}
    """




def write_supervisor_conf():
    pass


def config_virtualenv():
    pass






def add_vhost():
    domain = domain_input()
    additionDomain = raw_input("Please input your additional domain (if you have not additional domain than keep id blank):")
    workdirectory = raw_input("Please input your file directory(default is /home/www/"+domain+"):")
    if not os.path.isdir(workdirectory):
        os.mkdir(workdirectory)
    else:
        exit("The file directory is exist ,please check")








if __name__ == '__main__':
    params = sys.argv

    print params